package com.xframe.domain.e3sp.bu.sale;

import com.xframe.domain.BaseModel;
import com.xframe.xdal.core.annotation.AutoFill;
import com.xframe.xdal.core.annotation.XColumn;
import com.xframe.xdal.core.annotation.XQueryCondition;
import com.xframe.xdal.core.annotation.XTable;
import com.xframe.xdal.core.constant.AutoFillType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;

/**
 * com.xframe.domain.e3sp.bu.sale.DirectInoutView
 * @author zjj
 * @create 2024/4/20 10:39
 */
@Data
@Accessors(chain=true)
@XTable(value = "v_direct_inout_view", label = "DFPV直供订单出入库视图",dataSourceCode = "warehouse")
public class DirectInoutView extends BaseModel {

    /**
     * 大客户订单ID
     */
    @AutoFill(AutoFillType.Snowflake)
    @XColumn(name = "ctm_order_id", primaryKeyFlag = true,desc = "大客户订单ID")
    private Long ctmOrderId;

    /**
     * 国内活动包ID
     */
    @XColumn(name = "activity_id",desc = "国内活动包ID",nullFlag = true)
    private Long activityId;

    /**
     * 经销商ID
     */
    @XColumn(name = "dealer_id",desc = "经销商ID",nullFlag = true)
    private Long dealerId;

    /**
     * 零售客户ID
     */
    @XColumn(name = "customers_id",desc = "零售客户ID",nullFlag = true)
    private Long customersId;

    /**
     * 订单号
     */
    @XColumn(name = "order_no",desc = "直供订单号",length = 50)
    private String orderNo;

    /**
     * 订单类型
     * 0 = 普通订单 1 = 紧急订单 2=直送订单
     * 3=客户订单 4=日产订单 5=三包订单 6=活动订单 7=特殊订单
     */
    @XColumn(name = "order_type",desc = "订单类型")
    private Integer orderType;

    /**
     * 订单日期
     */
    @XColumn(name = "orderdate",desc = "订单日期")
    private Date orderDate;

    /**
     * 总金额
     */
    @XColumn(name = "total_amount",desc = "总金额")
    private BigDecimal totalAmount;

    /**
     * 现款金额
     */
    @XColumn(name = "cash_amount",desc = "现款金额")
    private BigDecimal cashAmount;

    /**
     * 折扣金额
     */
    @XColumn(name = "discount_amount",desc = "折扣金额")
    private BigDecimal discountAmount;

    /**
     * 期望到货日期
     */
    @XColumn(name = "hope_date",desc = "期望到货日期")
    private Date hopeDate;

    /**
     * 技术报告编号
     */
    @XColumn(name = "report_no",desc = "技术报告编号",nullFlag = true,length = 50)
    private String reportNo;

    /**
     * 经办人
     */
    @XColumn(name = "attn",desc = "经办人",nullFlag = true,length = 50)
    private String attn;

    /**
     * 收货地址
     */
    @XColumn(name = "delivery_address",desc = "收货地址",length = 200)
    private String deliveryAddress;

    /**
     * 备注
     */
    @XColumn(name = "remark",desc = "备注",nullFlag = true,length = 500)
    private String remark;


    /**
     * 状态
     * 1=新建 2=提交 3=审核通过 FP=分配中 OK= 分配完成 9 = 作废 CK = 出库 99 = 驳回
     */
    @XColumn(name = "status",desc = "状态",length = 20)
    private String status;

    /**
     * 运输方式 值列表类型 = 1003
     */
    @XColumn(name = "transportation",desc = "运输方式",nullFlag = true,length = 20)
    private String transportation;

    /**
     * 订单创建方式
     * 0 = 经销商创建 1 = 总部创建
     */
    @AutoFill(defVal = "0")
    @XColumn(name = "c_mode",desc = "订单创建方式")
    private Integer cMode;

    /**
     * 创建的经销商ID
     */
    @AutoFill(defVal = "0")
    @XColumn(name = "cid",desc = "创建的经销商ID",nullFlag = true)
    private Long cid;

    /**
     * 订单销退单ID
     */
    @XColumn(name = "return_id",desc = "订单销退单ID",nullFlag = true)
    private Long returnId;

    /**
     * 直供标记 0=否，1=是
     */
    @AutoFill(defVal = "0")
    @XColumn(name = "direct_flag",desc = "直供标记",nullFlag = true)
    private Integer directFlag;

    /**
     * DFPV订单号
     */
    @XColumn(name = "dfpv_orderno",desc = "DFPV订单号",nullFlag = true,length = 20)
    private String dfpvOrderno;

    /**
     * 担保ID
     */
    @XColumn(name = "guarid",desc = "担保ID",nullFlag = true)
    private Long guarid;


    /**
     * 特殊采购单类型
     */
    @XColumn(name = "specialtype",desc = "特殊采购单类型",nullFlag = true,length = 20)
    private String specialtype;

    /**
     * 入库单号
     */
    @XQueryCondition
    @AutoFill(value = AutoFillType.BILLGENERATOR,args = "VDRK,3",overwrite = false)
    @XColumn(name = "storagelistno",desc = "入库单号",uniqueFlag = true, length = 20)
    private String inNo;

    /**
     * 出库单号
     */
    @XQueryCondition
    @AutoFill(value = AutoFillType.BILLGENERATOR,args = "VDCK,3",overwrite = false)
    @XColumn(name = "storehouselistno",desc = "出库单号",uniqueFlag = true, length = 20)
    private String outNo;

    /**
     * 虚拟入库时间
     */
    @XQueryCondition
    @XColumn(name = "inout_date", desc = "出入库时间")
    private Date inoutDate;

    /**
     * 现款金额
     */
    @XColumn(name = "sum_cash_amount",desc = "现款金额")
    private BigDecimal sumCashAmount;

    /**
     * 折扣金额
     */
    @XColumn(name = "sum_discount_amount",desc = "折扣金额")
    private BigDecimal sumDiscountAmount;

    /**
     * 总金额
     */
    @XColumn(name = "sum_total_amount",desc = "总金额")
    private BigDecimal sumTotalAmount;

    /**
     * 总数量
     */
    @XColumn(name = "sum_num",desc = "总数量")
    private Integer sumNum;

    /**
     * 品种数
     */
    @XColumn(name = "sum_count",desc = "品种数")
    private Integer sumCount;

    /**
     * 经销商全称
     */
    @XColumn(name = "dealer_full_name",desc = "经销商全称",length = 100)
    private String dealerFullName;


}
